<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateRecordGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('record_goods', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('goods_id')->index()->nullable()->comment('商品ID');
            $table->integer('goods_sku_id')->index()->nullable()->comment('商品skuID');
            $table->integer('number')->index()->nullable()->comment('数量');
            $table->string('description', '255')->nullable()->comment('描述');
            $table->integer('style')->index()->default(1)->comment('状态1.新增、2.减少');
            $table->integer('type')->index()->default(1)->comment('状态1.入库、2.出售、3.过期、4.盘点');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('record_goods');
    }
}
